# ---------------------------------------------------------------------         
# Compiler selection                                                            
# ---------------------------------------------------------------------         

CCC = g++ -g

# ---------------------------------------------------------------------         
# Compiler options                                                              
# ---------------------------------------------------------------------         

CCOPT = -m64 -O3 -fPIC -fexceptions -DIL_STD -Wall -Wno-sign-compare #-g -DNDEBUG 

# ---------------------------------------------------------------------         
# Link options and libraries                                                    
# ---------------------------------------------------------------------         

CCFLAGS = $(CCOPT) 
CCLNFLAGS = -lm

#SRC     = dist.cpp dl.cpp heap.cpp mst2.cpp err.cpp neighbors.cpp flute.cpp flute_mst.cpp
#OBJ     = $(SRC:.cpp=.o)

#------------------------------------------------------------                   
#  make all      : to compile.                                     
#  make execute  : to compile and execute.                         
#------------------------------------------------------------    
all: ROUTE.exe

#ROUTE.exe: main.o ${OBJ} ece556.o 
#	/bin/rm -f ROUTE.exe
#	$(CCC) $(LINKFLAGS) $(CCFLAGS) main.o ${OBJ} ece556.o $(CCLNFLAGS) -o ROUTE.exe -lm

ROUTE.exe: main.o ece556.o 
	/bin/rm -f ROUTE.exe
	$(CCC) $(LINKFLAGS) $(CCFLAGS) main.o ece556.o $(CCLNFLAGS) -o ROUTE.exe

main.o: main.cpp ece556.h
	/bin/rm -f main.o
	$(CCC) $(CCFLAGS) main.cpp -c

ece556.o: ece556.cpp ece556.h  
	/bin/rm -f ece556.o
	$(CCC) $(CCFLAGS) ece556.cpp -c

#flute.o: flute_mst.c flute.cpp flute.h
#	/bin/rm -f flute.o
#	$(CCC) $(CCFLAGS) flute_mst.c flute.cpp -c

clean:
	/bin/rm -f *~ *.o ROUTE.exe 
